package com.bdqn.oa.utils;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author Zhouxw
 * @date 2022/7/21 14:35
 */
public class DateUtils {
    private final static Integer HOUR = 0;
    private final static Integer MINUTE = 0;
    private final static Integer SECOND = 0;

    /**
     * 生成只有年月日的LocalDateTime对象
     *
     * @param year  年
     * @param month 月
     * @param day   日
     * @return LocalDateTime对象
     */
    public static LocalDateTime getDate(int year, int month, int day) {
        return LocalDateTime.of(year, month, day, HOUR, MINUTE, SECOND);
    }

    public static LocalDateTime getLocalDateTime() {
        LocalDate localDate = LocalDate.now();
        return localDate.atTime(0, 0, 0);
    }
}
